package com.heima.order.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

@FeignClient("storage-service")
public interface StorageClient {
    /**
     * 扣减库存
     *
     * @param code  商品编号
     * @param count 要扣减的数量
     * @return 无
     */
    @PutMapping("/storage/{code}/{count}")
    public ResponseEntity deduct(@PathVariable("code") String code, @PathVariable("count") Integer count);
}
